package com.heima.search.controller.v1;

import com.heima.search.service.ApArticleService;
import com.heima.common.constants.article.ArticleConstants;
import com.heima.model.article.dtos.ArticleHomeDTO;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/article")
public class ArticleHomeController {
    @Autowired
    ApArticleService apArticleService;
    @PostMapping("load")
    public ResponseResult load(@RequestBody ArticleHomeDTO dto){
        //return apArticleService.load(ArticleConstants.LOADTYPE_LOAD_MORE,dto);
        //        return articleService.load(dto, ArticleConstans.LOADTYPE_LOAD_MORE);
        return apArticleService.load2(ArticleConstants.LOADTYPE_LOAD_MORE,dto,true);

    }


}
